FROM nginx:alpine
#RUN rm -rf /usr/share/nginx/html/*  
# 删除默认配置（可选）   
#RUN rm /etc/nginx/conf.d/default.conf

#RUN cp /dist/dist/wy /usr/share/nginx/html/index.html
#COPY nginx.conf /etc/nginx/conf.d/default.conf


RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories \
# 安装python3
&& apk add --update --no-cache python3 py3-pip \
&& rm -rf /var/cache/apk/*




WORKDIR /dist  
# 复制自定义文件   
COPY . /dist

RUN mkdir -p ~/.config/pip/ && \
    echo -e "[global]\nbreak-system-packages = true" > ~/.config/pip/pip.conf && \
    pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
   
EXPOSE 80
CMD ["python", "app/main.py"]